// $ANTLR 3.0.1 Euclid.g 2008-01-25 16:11:58

package Euclid;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class EuclidLexer extends Lexer {
    public static final int T21=21;
    public static final int MINUS=5;
    public static final int WS=18;
    public static final int STRING=17;
    public static final int FLOAT=16;
    public static final int POW=12;
    public static final int MOD=8;
    public static final int T20=20;
    public static final int NEWLINE=13;
    public static final int INT=15;
    public static final int EOF=-1;
    public static final int RPAREN=11;
    public static final int Tokens=22;
    public static final int LPAREN=10;
    public static final int DIV=7;
    public static final int PLUS=4;
    public static final int INT_DIV=9;
    public static final int MULT=6;
    public static final int T19=19;
    public static final int ID=14;
    public EuclidLexer() {;} 
    public EuclidLexer(CharStream input) {
        super(input);
    }
    public String getGrammarFileName() { return "Euclid.g"; }

    // $ANTLR start PLUS
    public final void mPLUS() throws RecognitionException {
        try {
            int _type = PLUS;
            // Euclid.g:6:6: ( '+' )
            // Euclid.g:6:8: '+'
            {
            match('+'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end PLUS

    // $ANTLR start MINUS
    public final void mMINUS() throws RecognitionException {
        try {
            int _type = MINUS;
            // Euclid.g:7:7: ( '-' )
            // Euclid.g:7:9: '-'
            {
            match('-'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end MINUS

    // $ANTLR start MULT
    public final void mMULT() throws RecognitionException {
        try {
            int _type = MULT;
            // Euclid.g:8:6: ( '*' )
            // Euclid.g:8:8: '*'
            {
            match('*'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end MULT

    // $ANTLR start DIV
    public final void mDIV() throws RecognitionException {
        try {
            int _type = DIV;
            // Euclid.g:9:5: ( '/' )
            // Euclid.g:9:7: '/'
            {
            match('/'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end DIV

    // $ANTLR start MOD
    public final void mMOD() throws RecognitionException {
        try {
            int _type = MOD;
            // Euclid.g:10:5: ( '%' )
            // Euclid.g:10:7: '%'
            {
            match('%'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end MOD

    // $ANTLR start INT_DIV
    public final void mINT_DIV() throws RecognitionException {
        try {
            int _type = INT_DIV;
            // Euclid.g:11:9: ( '\\\\' )
            // Euclid.g:11:11: '\\\\'
            {
            match('\\'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end INT_DIV

    // $ANTLR start LPAREN
    public final void mLPAREN() throws RecognitionException {
        try {
            int _type = LPAREN;
            // Euclid.g:12:8: ( '(' )
            // Euclid.g:12:10: '('
            {
            match('('); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end LPAREN

    // $ANTLR start RPAREN
    public final void mRPAREN() throws RecognitionException {
        try {
            int _type = RPAREN;
            // Euclid.g:13:8: ( ')' )
            // Euclid.g:13:10: ')'
            {
            match(')'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end RPAREN

    // $ANTLR start POW
    public final void mPOW() throws RecognitionException {
        try {
            int _type = POW;
            // Euclid.g:14:5: ( '^' )
            // Euclid.g:14:7: '^'
            {
            match('^'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end POW

    // $ANTLR start T19
    public final void mT19() throws RecognitionException {
        try {
            int _type = T19;
            // Euclid.g:15:5: ( '=' )
            // Euclid.g:15:7: '='
            {
            match('='); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end T19

    // $ANTLR start T20
    public final void mT20() throws RecognitionException {
        try {
            int _type = T20;
            // Euclid.g:16:5: ( '~' )
            // Euclid.g:16:7: '~'
            {
            match('~'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end T20

    // $ANTLR start T21
    public final void mT21() throws RecognitionException {
        try {
            int _type = T21;
            // Euclid.g:17:5: ( ',' )
            // Euclid.g:17:7: ','
            {
            match(','); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end T21

    // $ANTLR start INT
    public final void mINT() throws RecognitionException {
        try {
            int _type = INT;
            // Euclid.g:77:5: ( ( '0' .. '9' )+ )
            // Euclid.g:77:7: ( '0' .. '9' )+
            {
            // Euclid.g:77:7: ( '0' .. '9' )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( ((LA1_0>='0' && LA1_0<='9')) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // Euclid.g:77:7: '0' .. '9'
            	    {
            	    matchRange('0','9'); 

            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);


            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end INT

    // $ANTLR start FLOAT
    public final void mFLOAT() throws RecognitionException {
        try {
            int _type = FLOAT;
            // Euclid.g:78:7: ( ( '0' .. '9' )* '.' ( '0' .. '9' )+ )
            // Euclid.g:78:9: ( '0' .. '9' )* '.' ( '0' .. '9' )+
            {
            // Euclid.g:78:9: ( '0' .. '9' )*
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( ((LA2_0>='0' && LA2_0<='9')) ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // Euclid.g:78:9: '0' .. '9'
            	    {
            	    matchRange('0','9'); 

            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);

            match('.'); 
            // Euclid.g:78:23: ( '0' .. '9' )+
            int cnt3=0;
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( ((LA3_0>='0' && LA3_0<='9')) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // Euclid.g:78:23: '0' .. '9'
            	    {
            	    matchRange('0','9'); 

            	    }
            	    break;

            	default :
            	    if ( cnt3 >= 1 ) break loop3;
                        EarlyExitException eee =
                            new EarlyExitException(3, input);
                        throw eee;
                }
                cnt3++;
            } while (true);


            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end FLOAT

    // $ANTLR start ID
    public final void mID() throws RecognitionException {
        try {
            int _type = ID;
            // Euclid.g:79:4: ( ( 'a' .. 'z' | 'A' .. 'Z' )+ )
            // Euclid.g:79:6: ( 'a' .. 'z' | 'A' .. 'Z' )+
            {
            // Euclid.g:79:6: ( 'a' .. 'z' | 'A' .. 'Z' )+
            int cnt4=0;
            loop4:
            do {
                int alt4=2;
                int LA4_0 = input.LA(1);

                if ( ((LA4_0>='A' && LA4_0<='Z')||(LA4_0>='a' && LA4_0<='z')) ) {
                    alt4=1;
                }


                switch (alt4) {
            	case 1 :
            	    // Euclid.g:
            	    {
            	    if ( (input.LA(1)>='A' && input.LA(1)<='Z')||(input.LA(1)>='a' && input.LA(1)<='z') ) {
            	        input.consume();

            	    }
            	    else {
            	        MismatchedSetException mse =
            	            new MismatchedSetException(null,input);
            	        recover(mse);    throw mse;
            	    }


            	    }
            	    break;

            	default :
            	    if ( cnt4 >= 1 ) break loop4;
                        EarlyExitException eee =
                            new EarlyExitException(4, input);
                        throw eee;
                }
                cnt4++;
            } while (true);


            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end ID

    // $ANTLR start STRING
    public final void mSTRING() throws RecognitionException {
        try {
            int _type = STRING;
            // Euclid.g:80:8: ( '\\\"' ( . )* '\\\"' )
            // Euclid.g:80:10: '\\\"' ( . )* '\\\"'
            {
            match('\"'); 
            // Euclid.g:80:15: ( . )*
            loop5:
            do {
                int alt5=2;
                int LA5_0 = input.LA(1);

                if ( (LA5_0=='\"') ) {
                    alt5=2;
                }
                else if ( ((LA5_0>='\u0000' && LA5_0<='!')||(LA5_0>='#' && LA5_0<='\uFFFE')) ) {
                    alt5=1;
                }


                switch (alt5) {
            	case 1 :
            	    // Euclid.g:80:15: .
            	    {
            	    matchAny(); 

            	    }
            	    break;

            	default :
            	    break loop5;
                }
            } while (true);

            match('\"'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end STRING

    // $ANTLR start NEWLINE
    public final void mNEWLINE() throws RecognitionException {
        try {
            int _type = NEWLINE;
            // Euclid.g:81:9: ( ( '\\r' )? '\\n' )
            // Euclid.g:81:10: ( '\\r' )? '\\n'
            {
            // Euclid.g:81:10: ( '\\r' )?
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0=='\r') ) {
                alt6=1;
            }
            switch (alt6) {
                case 1 :
                    // Euclid.g:81:10: '\\r'
                    {
                    match('\r'); 

                    }
                    break;

            }

            match('\n'); 

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end NEWLINE

    // $ANTLR start WS
    public final void mWS() throws RecognitionException {
        try {
            int _type = WS;
            // Euclid.g:82:4: ( ( ' ' | '\\t' )+ )
            // Euclid.g:82:6: ( ' ' | '\\t' )+
            {
            // Euclid.g:82:6: ( ' ' | '\\t' )+
            int cnt7=0;
            loop7:
            do {
                int alt7=2;
                int LA7_0 = input.LA(1);

                if ( (LA7_0=='\t'||LA7_0==' ') ) {
                    alt7=1;
                }


                switch (alt7) {
            	case 1 :
            	    // Euclid.g:
            	    {
            	    if ( input.LA(1)=='\t'||input.LA(1)==' ' ) {
            	        input.consume();

            	    }
            	    else {
            	        MismatchedSetException mse =
            	            new MismatchedSetException(null,input);
            	        recover(mse);    throw mse;
            	    }


            	    }
            	    break;

            	default :
            	    if ( cnt7 >= 1 ) break loop7;
                        EarlyExitException eee =
                            new EarlyExitException(7, input);
                        throw eee;
                }
                cnt7++;
            } while (true);

            skip();

            }

            this.type = _type;
        }
        finally {
        }
    }
    // $ANTLR end WS

    public void mTokens() throws RecognitionException {
        // Euclid.g:1:8: ( PLUS | MINUS | MULT | DIV | MOD | INT_DIV | LPAREN | RPAREN | POW | T19 | T20 | T21 | INT | FLOAT | ID | STRING | NEWLINE | WS )
        int alt8=18;
        alt8 = dfa8.predict(input);
        switch (alt8) {
            case 1 :
                // Euclid.g:1:10: PLUS
                {
                mPLUS(); 

                }
                break;
            case 2 :
                // Euclid.g:1:15: MINUS
                {
                mMINUS(); 

                }
                break;
            case 3 :
                // Euclid.g:1:21: MULT
                {
                mMULT(); 

                }
                break;
            case 4 :
                // Euclid.g:1:26: DIV
                {
                mDIV(); 

                }
                break;
            case 5 :
                // Euclid.g:1:30: MOD
                {
                mMOD(); 

                }
                break;
            case 6 :
                // Euclid.g:1:34: INT_DIV
                {
                mINT_DIV(); 

                }
                break;
            case 7 :
                // Euclid.g:1:42: LPAREN
                {
                mLPAREN(); 

                }
                break;
            case 8 :
                // Euclid.g:1:49: RPAREN
                {
                mRPAREN(); 

                }
                break;
            case 9 :
                // Euclid.g:1:56: POW
                {
                mPOW(); 

                }
                break;
            case 10 :
                // Euclid.g:1:60: T19
                {
                mT19(); 

                }
                break;
            case 11 :
                // Euclid.g:1:64: T20
                {
                mT20(); 

                }
                break;
            case 12 :
                // Euclid.g:1:68: T21
                {
                mT21(); 

                }
                break;
            case 13 :
                // Euclid.g:1:72: INT
                {
                mINT(); 

                }
                break;
            case 14 :
                // Euclid.g:1:76: FLOAT
                {
                mFLOAT(); 

                }
                break;
            case 15 :
                // Euclid.g:1:82: ID
                {
                mID(); 

                }
                break;
            case 16 :
                // Euclid.g:1:85: STRING
                {
                mSTRING(); 

                }
                break;
            case 17 :
                // Euclid.g:1:92: NEWLINE
                {
                mNEWLINE(); 

                }
                break;
            case 18 :
                // Euclid.g:1:100: WS
                {
                mWS(); 

                }
                break;

        }

    }


    protected DFA8 dfa8 = new DFA8(this);
    static final String DFA8_eotS =
        "\15\uffff\1\23\6\uffff";
    static final String DFA8_eofS =
        "\24\uffff";
    static final String DFA8_minS =
        "\1\11\14\uffff\1\56\6\uffff";
    static final String DFA8_maxS =
        "\1\176\14\uffff\1\71\6\uffff";
    static final String DFA8_acceptS =
        "\1\uffff\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1"+
        "\uffff\1\16\1\17\1\20\1\21\1\22\1\15";
    static final String DFA8_specialS =
        "\24\uffff}>";
    static final String[] DFA8_transitionS = {
            "\1\22\1\21\2\uffff\1\21\22\uffff\1\22\1\uffff\1\20\2\uffff\1"+
            "\5\2\uffff\1\7\1\10\1\3\1\1\1\14\1\2\1\16\1\4\12\15\3\uffff"+
            "\1\12\3\uffff\32\17\1\uffff\1\6\1\uffff\1\11\2\uffff\32\17\3"+
            "\uffff\1\13",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "\1\16\1\uffff\12\15",
            "",
            "",
            "",
            "",
            "",
            ""
    };

    static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS);
    static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS);
    static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS);
    static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS);
    static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS);
    static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS);
    static final short[][] DFA8_transition;

    static {
        int numStates = DFA8_transitionS.length;
        DFA8_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA8_transition[i] = DFA.unpackEncodedString(DFA8_transitionS[i]);
        }
    }

    class DFA8 extends DFA {

        public DFA8(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 8;
            this.eot = DFA8_eot;
            this.eof = DFA8_eof;
            this.min = DFA8_min;
            this.max = DFA8_max;
            this.accept = DFA8_accept;
            this.special = DFA8_special;
            this.transition = DFA8_transition;
        }
        public String getDescription() {
            return "1:1: Tokens : ( PLUS | MINUS | MULT | DIV | MOD | INT_DIV | LPAREN | RPAREN | POW | T19 | T20 | T21 | INT | FLOAT | ID | STRING | NEWLINE | WS );";
        }
    }
 

}